package com.md.notes.model.module.log;

import android.app.Activity;

public class LoggerBuilder {
    private static LoggerABC singlenLogger;


    public static LoggerABC build(Activity activity){
        if (null != singlenLogger){
            return singlenLogger;
        }
        LoggerABC errLogger = new ErrorLogger(LoggerABC.ERROR);
        LoggerABC debugLogger = new DebugLogger(LoggerABC.DEBUG);
        LoggerABC infoLogger = new InfoLogger(LoggerABC.INFO);

        infoLogger.setActivity(activity);
        debugLogger.setActivity(activity);
        errLogger.setActivity(activity);

        errLogger.setNextLoggerABC(debugLogger);
        debugLogger.setNextLoggerABC(infoLogger);
        singlenLogger = errLogger;
        return errLogger;
    }
}
